/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#ifndef TYPEELEMENT
#define TYPEELEMENT

#define TE_SEQUENCE 1
#define TE_REFERENCE 2
#define TE_IDENTIFIED 3
#define TE_ABSTRACT 4
#define TE_DEFINITION 7
#define TE_BASIC 8
#define TE_ARRAY 9


#ifdef __cplusplus
extern "C" {
#endif

/* returns 0 if succesful, error otherwise. */
typedef int (*typeBind)( type_element * element, type_definition * definition );

struct type_element
{
	type_object object;  /* for type_object */
	type_definition * definition;
	typeBind bind;
	void* user_data;
};


int type_element_bind( type_element * element, type_definition * definition );

void type_element_init( type_element * element, typeBind bind );

type_library * type_element_get_library( type_element * element );

/* get the top level element for this definition. */
type_element * type_element_get_type_definition( type_element * element );

type_name * type_element_name( type_element * element );

int type_element_get_type_id( type_element * element );

/* return the static ids for the meta types. 
int type_element_type( type_element * element );
*/

int type_element_equal( type_element * element, type_name * name );

#ifdef __cplusplus
}
#endif



#endif

